package com.qfedu.zf.app.service;

import com.qfedu.zf.app.config.OpenFeignConfig;
import com.qfedu.zf.common.param.Listings;
import com.qfedu.zf.common.param.UserAdd;
import com.qfedu.zf.common.param.UserLogin;
import com.qfedu.zf.common.vo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "lc-userserver",configuration = OpenFeignConfig.class)
public interface UserFeign {

    @RequestMapping("/user/listingUser")
    public R listingUser(@RequestParam Map<String,Object> map);

    @RequestMapping("/user/register")
    public R register(@RequestBody UserAdd userAdd);

    @RequestMapping("/user/loginPass")
    public R loginPass(@RequestBody UserLogin userLogin);

    @RequestMapping("/user/loginCode")
    public R loginCode(@RequestBody UserLogin userLogin);

    @RequestMapping("/user/logout")
    public R logout();

    @RequestMapping("/user/selectById")
    R selectById();

    @RequestMapping(value = "/user/editNickname",method = RequestMethod.GET)
    R editNickname(@RequestParam("nickname") String nickname);

    @RequestMapping(value = "/user/editPhone",method = RequestMethod.GET)
    R editPhone(@RequestParam("code") String code,@RequestParam("phone") String phone);

    @RequestMapping(value = "/user/editAvatar",method = RequestMethod.GET)
    R editAvatar(@RequestParam("url")String url);

    @RequestMapping(value = "/user/posting",method = RequestMethod.POST)
    R addListing(@RequestBody Listings listing);

    @RequestMapping(value = "/user/listing")
    R listing(@RequestParam("id") String id);

    @RequestMapping("/user/coupon/list")
    R selectList();

    @RequestMapping(value = "/user/coupon/selectById")
    R selectByCouponId(@RequestParam("id")Integer id);

    @RequestMapping(value = "/user/coupon/add")
    R couponAdd(@RequestParam("id") Integer id);
    @RequestMapping("/user/report/list")
    R selectByReportList();

    @RequestMapping("/user/beReport/list")
    R beReport();

    @RequestMapping("/user/couponAdd/list")
    R selectCouponAddList();

    @RequestMapping(value = "/user/listingDelete")
    R listingDelete(@RequestParam("id") String id);

    @RequestMapping("/browse/list")
    R selectBrowseList(@RequestParam("id") Integer id);

    @RequestMapping("/user/list")
    R selectUserList();
}
